<?php
$host="db.seng.uvic.ca"; // Host name
$username="se321g01"; // Mysql username
$password="un8bi2YM"; // Mysql password
$db_name="se321g01"; // Database name
$tbl_name="user_info"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// Personal
$uname=$_POST['uname'];

// Get UID
$uid = $_GET['uid'];

$result = mysql_query("SELECT uid FROM user_info WHERE email='$uname' AND admin='1'");

$row = mysql_fetch_array($result);
$aid = $row['uid'];

// Go back to profile
header("location:./profile.php?uid=" . $uid . "&aid=" . $aid . "&tab=2");

?>
